/*
 * @Author: jswang
 * @Date: 2021-08-02 15:59:09
 * @LastEditTime: 2021-08-11 12:22:21
 */
import request from '@/utils/request'

//获取角色列表
export function getRoleList(params) {
    return request({
        url: '/sys/role',
        params
    })
}

//获取根据id查询企业
export function getCompanyInfo(companyId) {
    return request({
        url: `/company/${companyId}`
    })
}

//删除角色
export function deleteRole(id) {
    return request({
        url: `/sys/role/${id}`,
        method: 'delete'
    })
}

//读取角色详情
export function getRoleDetail(id) {
    return request({
        url: `/sys/role/${id}`
    })
}

//根据id更新角色
export function updateRole(data) {
    return request({
        url: `/sys/role/${data.id}`,
        method: 'put',
        data
    })
}

//新增角色
export function addRole(data) {
    return request({
        url: '/sys/role',
        method: 'post',
        data
    })
}

//分配权限
export function assignPerm(data) {
    return request({
        url: '/sys/role/assignPrem',
        method: 'put',
        data
    })
}